import axios from 'axios'
const baseURL = 'http://43.138.15.137:7000/api/private/v1'
const token = localStorage.getItem('token')
export default {
  methods: {
    async $http(url) {
      return await axios.get(baseURL + url, {
        headers: {
          'Authorization': token
        }
      })
    }
  }
}
// 修改前
export default {
  methods: { /*...*/ }
}
// 修改后
export default function() {
  return {
    methods: {
      $httpGet(url) {
        return this.$axios.get(url, {
          headers: { Authorization: this.token }
        })
      }
    }
  }
}